<div class="usuarios view">
	<?php echo $html->image('foto.jpg',array('class'=>'foto-perfil')); ?>
<h2><?php echo $usuario['Usuario']['nome']; ?></h2>
			ID: <?php echo $usuario['Usuario']['id']; ?><br />
			Login: <?php echo $usuario['Usuario']['login']; ?><br />
			Email: <?php echo $usuario['Usuario']['email']; ?><br />
			Senha: <?php echo $usuario['Usuario']['senha']; ?><br />
 	<?php if ($isFriend && $isFriend != 'N') { //se a solicitacao esta pendente e se o usuário não está bloqueado ?>
		  <br /><h1>* Você já tem uma amizade com <?php  echo $usuario['Usuario']['nome']; ?>.</h1>
	<?php } ?>

</div>
<div class="actions">
	<h3><?php __('Ações'); ?></h3>
	<ul>
		<?php if(!$isFriend || $isFriend == 'N'): ?>
			<li><?php echo $this->Html->link(__('Adicionar Amigo', true), array('action' => 'request_friendship', $usuario['Usuario']['id'])); ?></li>
		<?php else: ?>
			<li><?php echo $this->Html->link(__('Remover Amigo', true), array('action' => 'unregisterFriend', $usuario['Usuario']['id']), null, sprintf(__('Tem certeza que deseja descadastrar este amigo?', true))); ?></li>
		<?php endif; ?>
		<?php if($isFriend == 'N' && $unblockPermission): ?>
			<li><?php echo $this->Html->link(__('Desbloq. Usuário', true), array('action' => 'unblockFriend', $usuario['Usuario']['id'])); ?></li>
		<?php else: ?>
			<li><?php echo $this->Html->link(__('Bloquear Usuário', true), array('action' => 'blockFriend', $usuario['Usuario']['id'])); ?></li>
		<?php endif; ?>
		<li><?php echo $this->Html->link(__('Editar Usuário', true), array('action' => 'edit', $usuario['Usuario']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Deletar Usuário', true), array('action' => 'delete', $usuario['Usuario']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $usuario['Usuario']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Usuários', true), array('action' => 'index')); ?> </li>
		
		<li><?php echo $this->Html->link(__('Novo Usuário', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Usuários', true), array('controller' => 'usuarios', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Novo Amigo', true), array('controller' => 'usuarios', 'action' => 'add')); ?> </li>
	</ul>

</div>

<div class="related">
	<h3>Amigos de <?php echo $usuario['Usuario']['nome']; ?></h3>
	<?php if (!empty($amigos)):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Nome'); ?></th>
		<th><?php __('Login'); ?></th>
		<th><?php __('Email'); ?></th>
		<th class="actions"><?php __('Ações');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($amigos as $amigo):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $amigo['id'];?></td>
			<td><?php echo $amigo['nome'];?></td>
			<td><?php echo $amigo['login'];?></td>
			<td><?php echo $amigo['email'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('Ver', true), array('controller' => 'usuarios', 'action' => 'view', $amigo['id'])); ?>
				<?php echo $this->Html->link(__('Editar', true), array('controller' => 'usuarios', 'action' => 'edit', $amigo['id'])); ?>
				<?php echo $this->Html->link(__('Deletar', true), array('controller' => 'usuarios', 'action' => 'delete', $amigo['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $amigo['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('Novo Amigo', true), array('controller' => 'usuarios', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>